#coding:utf-8
'''
create on 2017-08-23
@author:sandy
'''

def sortArr(arr):
    if len(arr) == 0:  
        return  
    arr.sort(None,key=lambda v:v%10)

def seprateArr(sidArr):
    reArr = [[],[],[],[],[]]
    for sid in sidArr:
        t = sid / 100
        v = sid % 10
        reArr[t].append(sid)
        sortArr(reArr[t])
    return reArr

def testPeng(mj,mjArr):
    t = mj / 100
    v = mj % 10
    c = 0
    tmpArr = []
    tmpArr.append(mjArr)
    sptArr = seprateArr(tmpArr)
    if len(sptArr[t]) < 2:
        return False
    else:
        for tmj in sptArr[t]:
            if (tmj % 10) == v:
                c = c + 1
        if c == 2 or c == 3:
            return True
    return False

def testGang(mj,mjArr):
    t = mj / 100
    v = mj % 10
    c = 0
    tmpArr = []
    tmpArr.append(mjArr)
    sptArr = seprateArr(tmpArr)
    if len(sptArr[t]) < 2:
        return False
    else:
        for tmj in sptArr[t]:
            if (tmj % 10) == v:
                c = c + 1
        if c == 3:
            return True
    return False

def testHu(mj,mjArr):
    t = mj / 100
    v = mj % 10
    c = 0
    tmpArr = []
    tmpArr.append(mjArr)
    sptArr = seprateArr(tmpArr)
    
